package com.day.mapper;

import com.day.pojo.Dormitory;
import com.day.service.DormitoryService;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface DormitoryMapper {
    

    List<Dormitory> getDormitoryList();

    @Select("select * from dormitory where d_id = #{d_id};")
    Dormitory getDormitoryById(Integer d_id);

    @Insert("insert into dormitory values (0,#{d_name});")
    void addDormitory(Dormitory dormitory);

    @Delete("delete from dormitory where d_id = #{d_id};")
    void delDormitoryById(Integer d_id);

    @Update("update dormitory set d_name = #{d_name} where d_id = #{d_id};")
    void editDormitoryById(Dormitory dormitory);
}
